import datetime
from applications.extensions import db


class Config(db.Model):
    __tablename__ = 'admin_config'
    id = db.Column(db.Integer, primary_key=True, comment="主键ID")
    config_name = db.Column(db.String(100), comment="参数名称")
    config_key = db.Column(db.String(100), comment="参数键名")
    config_value = db.Column(db.String(100), comment="参数键值")
    config_type = db.Column(db.Integer, comment="系统内置（Y是 N否）")
    enable = db.Column(db.Integer, comment="是否启用")
    create_by = db.Column(db.Integer, comment="创建者")
    update_by = db.Column(db.Integer, comment="更新者")
    remark = db.Column(db.String(500), comment="备注")
    create_at = db.Column(db.DateTime, default=datetime.datetime.now, comment='创建时间')
    update_at = db.Column(db.DateTime, default=datetime.datetime.now, onupdate=datetime.datetime.now, comment='创建时间')